const app = getApp();
Page({
  data: {
    picture: '/images/integral_banner.png',
    navIndex: 0,
  },
  onLoad: function (options) {

  },
  onShow: function () {
    var that = this;
    that.getInfo();
  },
  getInfo:function(){
    var that = this;
    wx.showLoading({
      title: '加载中...',
    })
    app.request('score.product/index',{},'GET',false,function(res){
      let navWidth = 0;
      res.data.data.goodsList.map((v)=>{
        v['width'] = v.title.length * 40;
        return navWidth += v.title.length*40;
      })
      that.setData({
        navWidth: navWidth,
        pageShow: true,
        picture: res.data.data.topimg,
        score: res.data.data.score,
        list: res.data.data.goodsList,
        
      })
    })
  },
  navChoose(e) {
    this.setData({
      navIndex: e.currentTarget.dataset.index
    })
  },
  getFormid:function(e){
    app.getFormid(e);
  },
  skipPage:function(e){
    app.skipPage(e);
  },
  onReachBottom: function () {

  },
  onShareAppMessage: function () {

  }
})